package pizza;

class PizzaFactory 
{
	public enum PizzaType{HamAndMushroom,Deluxe,Hawaiian}
	public static Pizza createPizza(PizzaType pizzaType)
	{
		switch(pizzaType)
		{
			
			case Deluxe: return new DeluxPizza();
			case Hawaiian:return new HawaianPizza();
		}
	throw new IllegalArgumentException("tipul de pizza "+pizzaType+" nu se recunoaste.");
	}
}